﻿Public Module PublicFunction
    ''' <summary>
    ''' 获得Models目录的路径，已经包含了"/"。
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function ApplicationPath() As String
        Dim path As String
        '执行气象数据程序
        If My.Application.Info.DirectoryPath = "\" Then
            path = My.Application.Info.DirectoryPath
        Else
            path = My.Application.Info.DirectoryPath & "\"
        End If
        Return path
    End Function
    Public Function GetLastName(ByRef sName As String) As String
        Dim nStart As Short
        Dim nEnd As Short
        Dim nLen As Short
        nStart = 1
        nEnd = 1
        nLen = Len(sName)
        While nEnd <> 0
            nEnd = InStr(nStart, sName, "\")
            If nEnd <> 0 Then
                nStart = nEnd + 1
            End If
        End While
        GetLastName = Mid(sName, nStart, nLen - nStart + 1)
    End Function
End Module
